<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>clk_wiz: xclk_wiz_versal_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">clk_wiz
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xclk__wiz__versal__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xclk_wiz_versal_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> driver with different rates. </p>
<p>assigned to clock wizard 1. Modify this value as per your dynamic clock reconfiguration Clocking wizard</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver Who Date   Changes
</p>
<hr/>
<p>
1.3 sd  4/7/20 Initial version for Clock Wizard Example
1.4 sd  5/20/20 Use Macros and use readReg API
1.6 sd  7/7/23  Add SDT support.
1.8 sd  6/26/24 Update the device name and Baseaddress.
    sd  9/5/24  Add GetRate and multi clock support.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ab29b199c8ec2cd0ed0fee03752826661"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__versal__example_8c.html#ab29b199c8ec2cd0ed0fee03752826661">ClkWiz_Example</a> (<a class="el" href="struct_x_clk___wiz.html">XClk_Wiz</a> *IntcInstancePtr, u32 DeviceId)</td></tr>
<tr class="memdesc:ab29b199c8ec2cd0ed0fee03752826661"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the main entry point for the versal example using the <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> driver.  <a href="#ab29b199c8ec2cd0ed0fee03752826661">More...</a><br/></td></tr>
<tr class="separator:ab29b199c8ec2cd0ed0fee03752826661"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ac72face0b386c645cdba25e6d99967"><td class="memItemLeft" align="right" valign="top">u32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__versal__example_8c.html#a7ac72face0b386c645cdba25e6d99967">XClk_WaitForLock</a> (<a class="el" href="struct_x_clk___wiz___config.html">XClk_Wiz_Config</a> *CfgPtr_Dynamic)</td></tr>
<tr class="memdesc:a7ac72face0b386c645cdba25e6d99967"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the XClk_WaitForLock function, it will wait for lock to settle change frequency value.  <a href="#a7ac72face0b386c645cdba25e6d99967">More...</a><br/></td></tr>
<tr class="separator:a7ac72face0b386c645cdba25e6d99967"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xclk__wiz__versal__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the main function for <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> rate example.  <a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br/></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ab29b199c8ec2cd0ed0fee03752826661"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 ClkWiz_Example </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_clk___wiz.html">XClk_Wiz</a> *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>DeviceId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the main entry point for the versal example using the <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> driver. </p>
<p>This function will set up the system with interrupts handlers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DeviceId</td><td>is the unique device ID of the CLK_WIZ Subsystem core.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_FAILURE if the system setup failed.</li>
<li>XST_SUCCESS if successful. </li>
</ul>
</dd></dl>

<p>References <a class="el" href="struct_x_clk___wiz___config.html#aa737385b3fd370d1bb677f0b366cdbd0">XClk_Wiz_Config::BaseAddr</a>, <a class="el" href="struct_x_clk___wiz___config.html#ad27e675e3da734bc59621ddb146dc927">XClk_Wiz_Config::NumClocks</a>, <a class="el" href="xclk__wiz__versal__example_8c.html#a7ac72face0b386c645cdba25e6d99967">XClk_WaitForLock()</a>, <a class="el" href="group___overview.html#ga96e21929b605502ed7b693c0a2132b4e">XClk_Wiz_CfgInitialize()</a>, <a class="el" href="group___overview.html#ga5da48627691e7e979b7c4fbcb608796a">XClk_Wiz_GetRate()</a>, <a class="el" href="group___overview.html#ga862887391d91e336afb089947d1eea22">XClk_Wiz_LookupConfig()</a>, <a class="el" href="group___overview.html#ga8d853c1eaeeb4b89d06b7de0ff13d999">XCLK_WIZ_RECONFIG_OFFSET</a>, <a class="el" href="group___overview.html#gad966194a45d93fa34d0eb8ab8c2de08d">XClk_Wiz_SetLeafRateHz()</a>, and <a class="el" href="group___overview.html#ga0408e2c4fba6d9237aeb72db5c38164b">XClk_Wiz_SetRateHz()</a>.</p>

</div>
</div>
<a class="anchor" id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the main function for <a class="el" href="struct_x_clk___wiz.html" title="The XClk_Wiz driver instance data. ">XClk_Wiz</a> rate example. </p>
<p>If the ClkWiz_Example function which sets up the system succeeds, this function will set the desired rate.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_FAILURE if the interrupt example was unsuccessful.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Unless setup failed, main will never return since </dd></dl>

<p>References <a class="el" href="xclk__wiz__setrate__example_8c.html#a35fe542e629f6c41502f67458005acb1">ClkWiz_Example()</a>.</p>

</div>
</div>
<a class="anchor" id="a7ac72face0b386c645cdba25e6d99967"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u32 XClk_WaitForLock </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_clk___wiz___config.html">XClk_Wiz_Config</a> *&#160;</td>
          <td class="paramname"><em>CfgPtr_Dynamic</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the XClk_WaitForLock function, it will wait for lock to settle change frequency value. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CfgPtr_Dynamic</td><td>provides pointer to clock wizard dynamic config</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the lock occurs.</li>
<li>XST_FAILURE if timeout.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="struct_x_clk___wiz___config.html#aa737385b3fd370d1bb677f0b366cdbd0">XClk_Wiz_Config::BaseAddr</a>.</p>

<p>Referenced by <a class="el" href="xclk__wiz__versal__example_8c.html#ab29b199c8ec2cd0ed0fee03752826661">ClkWiz_Example()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
